<?php 
defined('IN_ADMIN') or exit('No permission resources.');
include $this->admin_tpl('header', 'admin');
$modelid = 100;
?>
<div class="pad-10">
<form method="post" action="?m=daoshi&c=admin_daoshi&a=add" name="myform" id="myform">
<table class="table_form" width="100%" cellspacing="0">
<tbody>
	<tr>
		<th width="80"><strong>类别</strong></th>
		<td>
		<?php echo select_category('category_daoshi_'.$modelid,$parentid,'name="announce[catid]" id="parentid"',L('please_select_parent_category'),0,-1);?>
		</td>
	</tr>
    <tr>
		<th width="80"><strong>姓名</strong></th>
		<td><input name="announce[name]" id="name" class="input-text" type="text" size="50" ></td>
	</tr>
    <tr>
		<th width="80"><strong>照片</strong></th>
		<td><?php echo form::images('announce[image]', $id = 'image', $value = '', $moudle='', $catid='', $size = 50, $class = '', $ext = '', $alowexts = '',$thumb_setting = array(),$watermark_setting = 1 );?></td>
	</tr>
	<tr>
		<th><strong><?php echo L('announce_content')?></strong></th>
		<td><textarea name="announce[description]" id="content"></textarea><?php echo form::editor('content');?></td>
	</tr>
	<tr style="display:none">
		<th><strong><?php echo L('announce_status')?></strong></th>
		<td><input name="announce[passed]" type="radio" value="1" checked>&nbsp;<?php echo L('pass')?>&nbsp;&nbsp;<input name="announce[passed]" type="radio" value="0">&nbsp;<?php echo L('unpass')?></td>
	</tr>
	</tbody>
</table>
<input type="submit" name="dosubmit" id="dosubmit" value=" <?php echo L('ok')?> " class="dialog">&nbsp;<input type="reset" class="dialog" value=" <?php echo L('clear')?> ">
</form>
</div>
</body>
</html>
<script type="text/javascript">
function load_file_list(id) {
	if (id=='') return false;
	$.getJSON('?m=admin&c=category&a=public_tpl_file_list&style='+id+'&module=announce&templates=show&name=announce&pc_hash='+pc_hash, function(data){$('#show_template').html(data.show_template);});
}

$(document).ready(function(){
	$.formValidator.initConfig({formid:"myform",autotip:true,onerror:function(msg,obj){window.top.art.dialog({content:msg,lock:true,width:'220',height:'70'}, function(){this.close();$(obj).focus();})}});
	$("#content").formValidator({autotip:true,onshow:"",onfocus:"<?php echo L('announcements_cannot_be_empty')?>"}).functionValidator({
	    fun:function(val,elem){
	    //获取编辑器中的内容
		var oEditor = CKEDITOR.instances.content;
		var data = oEditor.getData();
        if(data==''){
		    return "<?php echo L('announcements_cannot_be_empty')?>"
	    } else {
			return true;
		}
	}
	});
});
</script>